#include"TcpServer.hpp"
#include<memory>
#include<string>
#include"http.hpp"



void UseOfServer(char* ch[])
{
    LOG(LogLevel::INFO) << "Useage: " << ch[0] << " port" << "\r\n";
}

HttpResponse Login(HttpRequest& reqline)
{

}




int main(int argc,char* argv[])
{
    EnableScreen();
    if(argc != 2)
    {
        UseOfServer(argv);
        exit(1);
    }

    http _http;
    _http.Resigter("/login",Login);

    std::unique_ptr<TcpServer> _server = std::make_unique<TcpServer>(std::stoi(argv[1]),
    [&_http](std::string& _buffer)->std::string{
        return _http.CreateResponse(_buffer);
    });
    _server->Init();
    _server->Start();
    return 0;
}